//
//  NumberViewCell.m
//  coba-iOS
//
//  Created by 郭四虎 on 15/11/18.
//  Copyright © 2015年 YouKu. All rights reserved.
//

#import "NumberViewCell.h"

@implementation NumberViewCell

- (void)awakeFromNib {
    // Initialization code
    [super awakeFromNib];
}

- (void)showModel:(NumberModel *)model
{
    self.dateLb.text = [MyDateformater formaterYMH:model.integral_time];
    
    NSString *str;
    if ([model.itg_gain_from isEqualToString:@"0"]) {
        str = @"app下载";
    }else if([model.itg_gain_from isEqualToString:@"1"]){
        str = @"签到奖励";
    }else if([model.itg_gain_from isEqualToString:@"2"]){
        str = @"兑换相关";
    }else{
        str = @"其他";
    }
    self.comeLb.text = str;
    
    if (model.itg_gain_num.integerValue>0) {
        self.addnumLb.textColor = [UIColor redColor];
        self.addnumLb.text = [NSString stringWithFormat:@"+%@",model.itg_gain_num];
    }else{
        self.addnumLb.textColor = [UIColor greenColor];
        self.addnumLb.text = [NSString stringWithFormat:@"%@",model.itg_gain_num];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
